home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 007a / 899track.zip / 899MODEX.PRO < prev    next >
Text File  |  1990-03-06  |  5KB  |  138 lines

  1. project "899"
  2. include "899glob.pro"
  3.  
  4. % 899MODEX.PRO -- Modifies or defines current information
  5. %    Uses window #20, 21
  6. %    Globals contained in this file::
  7. %    modspecs
  8. CONSTANTS
  9.   ESTR = "Use cursors to move, Ctrl-Bksp to delete line, ESC when done"
  10.  
  11. DATABASE - modex
  12.   determ oldinf(gsList,gs,gsList,gs,gs,gs,gs,gsList)
  13.   
  14. PREDICATES
  15.   domod
  16.   showdef
  17.   pmodex(gs)
  18.   vernonull(gs,gs)
  19.  
  20. CLAUSES
  21.   modspecs(label(Cats,Lab,Addr,City,State,Zip,Phone,Comments),
  22.       label(Ncats,NLab,NAddr,NCity,NState,NZip,NPhone,NComments)) :-
  23.       makewindow(21,blue,blue," Current Data Specs ",6,0,18,79),
  24.       makewindow(20,green,green," Modification Interface ",0,0,6,79),
  25.       assert(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
  26.       showdef,
  27.       domod,
  28.       retract(oldinf(Ncats,Nlab,Naddr,NCity,NState,NZip,NPhone,NComments),modex),
  29.       removewindow, removewindow.
  30.  
  31.   domod :-
  32.       getbacktrack(Btop),  % Get this to set up the following
  33.       Tit = "Use cursors to select label section,\17\217 selects ",
  34.       repeat,
  35.         Choices = ["RECORD LABEL","CATEGORIES","ADDRESS INFO","CITY",
  36.                    "STATE","ZIP","PHONE","COMMENTS","DONE -- SAVE INFORMATION"],
  37.         show_get(Choices,Choice,Tit),
  38.         clearwindow, cursor(0,0),
  39.         pmodex(Choice),
  40.         showdef,
  41.       Choice = "DONE -- SAVE INFORMATION", !,
  42.       cutbacktrack(Btop).
  43.  
  44.   pmodex("RECORD LABEL") :- !, % LAB
  45.       retract(oldinf(Cats,_,Addr,City,State,Zip,Phone,Comments),modex),
  46.       nl,
  47.       write("Enter new label name --> "),
  48.       readln(NLab),
  49.       assert(oldinf(Cats,NLab,Addr,City,State,Zip,Phone,Comments),modex).
  50.   pmodex("CATEGORIES") :- !, % CATS
  51.       getMusicTypes(AllTypes),
  52.       getbacktrack(Btop),
  53.       Tit = "Use cursors to select category,\17\217 selects,ESC=New Category ",
  54.       repeat,
  55.         retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
  56.         clearwindow, cursor(0,0),
  57.         show_get(AllTypes,SelectType,Tit),
  58.         vernonull(SelectType,ChosenType),
  59.         Ncats = [ChosenType|Cats],
  60.         assert(oldinf(NCats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
  61.         showdef,
  62.         write("Add more categories to this label (Y/N)? "),
  63.       not(askyn),  % A NO continues
  64.       cutbacktrack(Btop).
  65.   pmodex("ADDRESS INFO") :-  % Addr  ( non exitisting )
  66.       oldinf(_,_,[],_,_,_,_,_),
  67.       edit_setup([""],estr),
  68.       edit_descr, !, % Edit the thing
  69.       edit_setdown(Naddr), % New address list
  70.       retract(oldinf(Cats,Lab,_,City,State,Zip,Phone,Comments),modex),
  71.       assert(oldinf(Cats,Lab,NAddr,City,State,Zip,Phone,Comments),modex).
  72.   pmodex("ADDRESS INFO") :- !, % Addr Existing
  73.       retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
  74.       edit_setup(Addr,estr),
  75.       edit_descr, !, % Edit the thing
  76.       edit_setdown(Naddr), % New address list
  77.       assert(oldinf(Cats,Lab,NAddr,City,State,Zip,Phone,Comments),modex).
  78.   pmodex("CITY") :- !, % City
  79.       retract(oldinf(Cats,Lab,Addr,_,State,Zip,Phone,Comments),modex),
  80.       write("Enter new city --> "),
  81.       readln(NCity),
  82.       assert(oldinf(Cats,Lab,Addr,NCity,State,Zip,Phone,Comments),modex).
  83.   pmodex("STATE") :- !, % State
  84.       retract(oldinf(Cats,Lab,Addr,City,_,Zip,Phone,Comments),modex),
  85.       write("Enter new state --> "),
  86.       readln(NState),
  87.       assert(oldinf(Cats,Lab,Addr,City,NState,Zip,Phone,Comments),modex).
  88.   pmodex("ZIP") :- !, % Zip
  89.       retract(oldinf(Cats,Lab,Addr,City,State,_,Phone,Comments),modex),
  90.       write("Enter new Zip Code --> "),
  91.       readln(NZip),
  92.       assert(oldinf(Cats,Lab,Addr,City,State,NZip,Phone,Comments),modex).
  93.   pmodex("PHONE") :- !, % Phone
  94.       retract(oldinf(Cats,Lab,Addr,City,State,Zip,_,Comments),modex),
  95.       write("Enter new Phone --> "),
  96.       readln(NPhone),
  97.       assert(oldinf(Cats,Lab,Addr,City,State,Zip,NPhone,Comments),modex).
  98.   pmodex("COMMENTS") :-  % Comments non existing
  99.       oldinf(_,_,_,_,_,_,_,[]),
  100.       edit_setup([""],estr),
  101.       edit_descr, !, % Edit the thing
  102.       edit_setdown(NComments), % New comment
  103.       retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,_),modex),
  104.       assert(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,NComments),modex).
  105.   pmodex("COMMENTS") :- !, % Comments existing
  106.     retract(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),modex),
  107.       edit_setup(Comments,estr),
  108.       edit_descr, !, % Edit the thing
  109.       edit_setdown(NComments), % New address list
  110.       assert(oldinf(Cats,Lab,Addr,City,State,Zip,Phone,NComments),modex).
  111.   pmodex(_).
  112.  
  113.   vernonull("",NewType) :-  %
  114.       write("New Category name --> "),
  115.       cursor(CurrX,CurrY),
  116.       readln(NewCat),
  117.       cursor(CurrX,CurrY),
  118.       upper_lower(NewType,NewCat),
  119.       write(NewType), nl,
  120.       getMusicTypes(CurrList),
  121.       not(sameMusicCategory(NewType,CurrList)), !,
  122.       assertz(category(NewType)).
  123.   vernonull(X,X).
  124.  
  125.   showdef :-
  126.       shiftwindow(21),
  127.       clearwindow,
  128.       oldinf(Cats,Lab,Addr,City,State,Zip,Phone,Comments),
  129.       write("RECORD LABEL  : '",Lab,"'\n"),
  130.       write("ADDRESS INFO  :  ",Addr,'\n'),
  131.       write("C, S  Z       :  ",City,' ',State,"  ",Zip,'\n'),
  132.       write("PHONE         :  ",Phone,'\n'),
  133.       write("CATEGORIES --\n"),
  134.       writelist(Cats,5),
  135.       write("COMMENTS --\n"),
  136.       writelist(Comments,0),
  137.       shiftwindow(20).
  138.